package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TestDataScopeMapper;
import com.ruoyi.system.domain.TestDataScope;
import com.ruoyi.system.service.ITestDataScopeService;

/**
 * testScopeService业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-06
 */
@Service
public class TestDataScopeServiceImpl implements ITestDataScopeService 
{
    @Autowired
    private TestDataScopeMapper testDataScopeMapper;

    /**
     * 查询testScope
     * 
     * @param id testScopeID
     * @return testScope
     */
    @Override
    public TestDataScope selectTestDataScopeById(Long id)
    {
        return testDataScopeMapper.selectTestDataScopeById(id);
    }

    /**
     * 查询testScope列表
     * 
     * @param testDataScope testScope
     * @return testScope
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    @DataSource(value = DataSourceType.SLAVE)
    public List<TestDataScope> selectTestDataScopeList(TestDataScope testDataScope)
    {
        return testDataScopeMapper.selectTestDataScopeList(testDataScope);
    }

    /**
     * 新增testScope
     * 
     * @param testDataScope testScope
     * @return 结果
     */
    @Override
    public int insertTestDataScope(TestDataScope testDataScope)
    {
        return testDataScopeMapper.insertTestDataScope(testDataScope);
    }

    /**
     * 修改testScope
     * 
     * @param testDataScope testScope
     * @return 结果
     */
    @Override
    public int updateTestDataScope(TestDataScope testDataScope)
    {
        return testDataScopeMapper.updateTestDataScope(testDataScope);
    }

    /**
     * 批量删除testScope
     * 
     * @param ids 需要删除的testScopeID
     * @return 结果
     */
    @Override
    public int deleteTestDataScopeByIds(Long[] ids)
    {
        return testDataScopeMapper.deleteTestDataScopeByIds(ids);
    }

    /**
     * 删除testScope信息
     * 
     * @param id testScopeID
     * @return 结果
     */
    @Override
    public int deleteTestDataScopeById(Long id)
    {
        return testDataScopeMapper.deleteTestDataScopeById(id);
    }
}
